<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 小夏 < 449134904@qq.com>
// +----------------------------------------------------------------------
namespace app\admin\validate;

use app\admin\model\RouteModel;
use think\Validate;

class GoodsValidate extends Validate
{
    protected $rule = [
        'categories' => 'require',
        'post_title' => 'require',
        'post_price' => 'require|number',
        'post_stock' => 'require|number',
        'post_score' => 'require|number',
        'post_old_price' => 'require|number',
        'post_content'=> 'require',
        'more.thumbnail'=> 'require',


    ];
    protected $message = [
        'categories.require' => '请指定商品分类！',
        'post_title.require' => '商品标题不能为空！',
        'post_price.require' => '商品售价不能为空！',
        'post_price.number' => '商品售价必须为数字！',
        'post_stock.require' => '商品库存不能为空！',
        'post_old_price.number' => '商品原价必须为数字！',
        'post_score.number' => '商品积分必须为数字！',
        'post_stock.number' => '商品库存必须为数字！',
        'more.thumbnail.require' => '商品缩略图不能为空！',
        'post_old_price.require' => '商品原价不能为空！',
        'post_score.require' => '商品积分不能为空！',
    ];

    protected $scene = [
//        'add'  => ['user_login,user_pass,user_email'],
//        'edit' => ['user_login,user_email'],
    ];
}